#include "clientsocket.h"

class CClientSocket::CInternal
{
public:
    CInternal() {};
    ~CInternal() {};

public:
    void setProxyWnd(HWND hProxyWnd) {}
    void loadConfig() {}

public:
    SOCKET	m_hSocket;
    short	m_nPort;
    char	m_szServer[64];
    long	m_nLastDataTime;
    long	m_nHeartbeatInterval;
    CRITICAL_SECTION	m_csLastDataTime;
    HANDLE	m_hSendDataThread;
    HANDLE	m_hRecvDataThread;
};

CClientSocket::CClientSocket()
    : m_internal(nullptr)
    , m_internal_cpp14_ptr(std::make_unique<CInternal>())
{
    m_internal = new CInternal;
    m_internal_cpp11_ptr.reset(new CInternal);
}

CClientSocket::~CClientSocket()
{
    if (m_internal) {
        delete m_internal;
        m_internal = nullptr;
    }
}

void CClientSocket::setProxyWnd(HWND hProxyWnd)
{
    if (m_internal) {
        m_internal->setProxyWnd(hProxyWnd);
    }
}

void CClientSocket::loadConfig()
{
    if (m_internal) {
        m_internal->loadConfig();
    }
}
